package com.fit.dao.destinationOffer;

import java.util.List;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;

import com.fit.entities.DestinationOffer;

public class DestinationOfferDAOImpl implements DestinationOfferDAO {

	@Inject
	private Session session;

	public boolean save(DestinationOffer destinationOffer) {
		if (destinationOffer != null) {
			session.save(destinationOffer);
			return true;
		}
		return false;
	}

	public DestinationOffer findById(Long id) {
		return (DestinationOffer) session.get(DestinationOffer.class, id);
	}

	public List<DestinationOffer> findAll() {
		return session.createCriteria(DestinationOffer.class).list();
	}

}
